#include "AnimationDef.h"

cAnimation::cAnimation()
{
	m_Name = NULL;
	m_Bone = NULL;
	m_Next = NULL;

	m_NumTranslationKeys = 0;
	m_NumScaleKeys = 0;
	m_NumRotationKeys = 0;
	m_NumMatrixKeys = 0;

	m_TranslationKeys = NULL;
	m_ScaleKeys = NULL;
	m_RotationKeys = NULL;
	m_MatrixKeys = NULL;
}

cAnimation::~cAnimation()
{
	delete [] m_Name;
	delete [] m_TranslationKeys;
	delete [] m_ScaleKeys;
	delete [] m_RotationKeys;
	delete [] m_MatrixKeys;
}

void cAnimation::DeleteAni()
{
	cAnimation * pNext = m_Next;
	delete this;

	if (pNext)
	{
		pNext -> DeleteAni();
	}
}

cAnimationSet::cAnimationSet()
{
	m_Name = NULL;
	m_Length = 0;
	m_Next = NULL;
	m_NumAnimations = 0;
	pCurAnimation = NULL;
}

cAnimationSet::~cAnimationSet()
{
	delete [] m_Name;
	pCurAnimation -> DeleteAni();
}

void cAnimationSet::DeleteAniSet()
{
	cAnimationSet * pNext = m_Next;
	delete this;

	if (pNext)
	{
		pNext -> DeleteAniSet();
	}
}

